<?php

final class ModulesFactory {
    private static $instance = null;
    private static $modulesSet = array();

    public static function getInstance () {
        if (!self::$instance) {
            self::$instance = new self();
        }
        return self::$instance;
    }

    public function createBaseTools () {
        if (isset(self::$modulesSet['BaseTools'])) {
            return self::$modulesSet['BaseTools'];
        }
        require_once 'modules/tools/BaseTools.php';
        self::$modulesSet['BaseTools'] = new BaseTools();
        return self::$modulesSet['BaseTools'];
    }

}
